home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / mus / play / SPLibDev.lha / superplay-lib_DEV / Programmers / Oberon-2 / Interfaces / spObjects.mod < prev    next >
Encoding:
Text File  |  1997-08-15  |  6.6 KB  |  189 lines

  1. (********************************************************************
  2.  
  3. :Program.     spObjects.mod
  4. :Contents.    interface module for superplay objects
  5. :Copyright.   © 1994 by Andreas R. Kleinert
  6. :Language.    Oberon-2
  7. :Translator.  A+L Amiga Oberon Compiler V3.11d
  8. :History.     V2.1  indy  25-Dec-95 first translation of c include
  9. :History.     V2.2  indy  05-Jul-96 update: c include V2.2(21.10.1995)
  10. :History.     V5.1  indy  07-Jan-96 update: c include V5.1(08.08.1996)
  11. *********************************************************************)
  12.  
  13. MODULE spObjects;
  14.  
  15. (*
  16.   $VER: spObjects 5.1 (07.01.96)
  17.  
  18.   This Oberon-2 interface module contains the c-includes:
  19.   -------------------------------------------------------
  20.     spobjects/spobjectbase.h
  21.       Version    : 5.1
  22.       Date       : 8.8.1996
  23.       Written by : Andreas R. Kleinert
  24.  
  25.     spobjects/spobjects.h
  26.       Version    : 5.1
  27.       Date       : 8.8.1996
  28.       Written by : Andreas R. Kleinert
  29. *)
  30.  
  31.  
  32. IMPORT
  33.   e   *: Exec;
  34. (*****************************************************************************)
  35.  
  36.  
  37. TYPE
  38.   SPObjectBasePtr  * = UNTRACED POINTER TO SPObjectBase;
  39.   ObjectNodePtr    * = UNTRACED POINTER TO ObjectNode;
  40.   SampleListPtr    * = UNTRACED POINTER TO SampleList;
  41.   SampleEntryPtr   * = UNTRACED POINTER TO SampleEntry;
  42.   CheckFilePtr     * = UNTRACED POINTER TO CheckFile;
  43.  
  44.  
  45.   ObjectNode * = STRUCT(node *: e.Node) (* chaining Node *)
  46.  
  47.     version          * : LONGINT;           (* Library-Version of spobject           *)
  48.  
  49.     objectType       * : LONGINT;           (* see below                             *)
  50.  
  51.     fileName         * : ARRAY 108 OF CHAR; (* use 30, as in struct FileInfoBlock    *)
  52.  
  53.     typeID           * : ARRAY 32 OF CHAR;  (* e.g. "MED"                            *)
  54.     typeCode         * : LONGINT;           (* ... and its appropriate Code,  ,      *)
  55.                                             (* assigned by superplay.library LATER.  *)
  56.  
  57.     subTypeNum       * : LONGINT;           (* actually available SubTypes           *)
  58.                                             (* (maximum 16) of the spobject.         *)
  59.  
  60.     subTypeID        * : ARRAY 16, 16 OF CHAR; (* e.g. "MMD0" or "MMD1"                 *)
  61.     subTypeCode      * : ARRAY 16 OF LONGINT;  (* ... and their appropriate Codes,      *)
  62.                                                (* assigned by superplay.library LATER.  *)
  63.  
  64.     backgroundReplay * : LONGINT;           (* Runs in the Background ? (Boolean)    *)
  65.  
  66.     (* may grow dependent on spo_Version *)
  67.   END;
  68.  
  69.  
  70. CONST
  71.   version - = 3;
  72.  
  73.    (* ^ DO NOT USE THIS DEFINE IN SOURCECODE !  *)
  74.    (*   AVOID INCREASING IT VIA RECOMPILATION ! *)
  75.   
  76.   objectTypeNone      - = 0;
  77.   objectTypeUnknown   - = objectTypeNone;
  78.   objectTypeIllegal   - = 0FFFFFFFFH;
  79.   
  80.   objectTypeSample    - = 1;  (* Raw Sample                 *)
  81.   objectTypeModule    - = 2;  (* Specific Sound Module      *)
  82.   
  83.   (* There may be more types in the future : simply reject unknown types. *)
  84.  
  85.  
  86.   (* ----------------------------------------------------------------------- *)
  87.  
  88. TYPE                                          (* Header of "SampleEntry"-List *)
  89.   SampleList * = STRUCT(entryList *: e.List); (* List itself                  *)
  90.     numEntries * : LONGINT;                   (* number of entries in List    *)
  91.   END;
  92.  
  93.  
  94.   SampleEntry * = STRUCT(node*: e.Node) (* may e.g. contain SampleData *)
  95.                                         (* the chaining Node           *)
  96.  
  97.     version       * : LONGINT;         (* SPObject's Version (2)      *)
  98.     type          * : LONGINT;         (* Sample ?                    *)
  99.  
  100.     (* The following entries are only valid, if type is == typeSample *)
  101.  
  102.     sampleBuffer  * : e.APTR;          (* SampleData (CHIP-Ram)       *)
  103.     sampleSize    * : LONGINT;         (* size of SampleData in Bytes *)
  104.  
  105.     sampleBits    * : LONGINT;         (* 8, 16                       *)
  106.     samplesPerSec * : LONGINT;         (* as needed with audio.device *)
  107.     volume        * : LONGINT;         (* as needed with audio.device *)
  108.  
  109.     (* more entries may follow in the future *)
  110.   END;
  111.  
  112.  
  113. CONST
  114.   typeNone    - = 0;
  115.   typeUnknown - = typeNone;
  116.   typeIllegal - = 0FFFFFFFFH;
  117.   
  118.   typeSample  - = 1; (* Entry contains Sample Data *)
  119.  
  120.   (* There may be more types in the future : simply reject unknown types.
  121.      Do not examine unknown SampleEntry-Types. They may contain data,
  122.      which is structured different from the above in the future !
  123.   *)
  124.  
  125.  
  126.  (* This structure has to be passed to SPObject's SPO_CheckFileType()
  127.     function, if media other than SPO_MEDIUM_DISK are used for reading.
  128.   *)
  129.  
  130. TYPE
  131.   CheckFile * = STRUCT
  132.     medium * : LONGINT;   (* MEDIUM_...     *)
  133.     future * : LONGINT;   (* as usual       *)
  134.   END;
  135.   (* -----------------------------------------------------------------------*)
  136.  
  137.  
  138.    (* An external support-library for the superplay.library is called a
  139.       "spobject".
  140.       Each spobject has to contain a "SPO_ObjectNode" structure (as follows)
  141.       in its Library-Header, which later will be READ and MODIFIED by
  142.       the superplay.library.
  143.       Because the superplay.library supports three different sorts
  144.       of SPObjects at the time (internal, independent and external),
  145.       there are three different types of this structure (might be more in
  146.       the future), which can be identified via their "spo_ObjectType".
  147.    *)
  148.  
  149.    (* The Construction of a spobject :
  150.       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  151.  
  152.       The Library Base
  153.       ----------------
  154.       Version information: only the revision can be set freely
  155.       (see structure described below)
  156.  
  157.       The Function Table
  158.       ------------------
  159.       (see <pragmas/spobjects.h>)
  160.  
  161.    *)
  162.  
  163. (* *************************************************** *
  164.  * *                                                 * *
  165.  * * Library base Definition for spobjects           * *
  166.  * *                                                 * *
  167.  * *************************************************** *)
  168.  
  169. TYPE
  170.   SPObjectBase   - = STRUCT (libNode - : e.Library) (* Exec LibNode                   *)
  171.     spObject*  : ObjectNodePtr;       (* POINTER to initialized         *)
  172.                                       (* SPO_ObjectNode                 *)
  173.                                       (* Must be AllocVec()'ed, will be *)
  174.                                       (* modified and delocated by      *)
  175.                                       (* superplay.library later.       *)
  176.     reserved*: ARRAY 32 OF LONGINT;   (* Reserved for future expansion. *)
  177.                                       (* Always NULL yet (Version 1).   *)
  178.  
  179.     (*
  180.       Private data of the spobject, not to be accessed
  181.       by superplay.library, may follow.
  182.     *)
  183.   END;
  184.  
  185. VAR
  186.   base *: SPObjectBasePtr;
  187.  
  188. END spObjects.
  189.